package cn.springcloud.provider.controller;


import cn.springcloud.provider.utils.RedisUtil;
import com.alibaba.fastjson.JSONObject;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("redis")
public class RedisController   {


    @PostMapping("setKey")
    public JSONObject setKey(String key ,String value){
        JSONObject jsonObject = new JSONObject();
        RedisUtil.set(key,value);
        jsonObject.put("msg","添加key成功") ;
        return jsonObject ;
    }


}
